<template>
	<view class="order">
		<view class="order-title">  <text style="font-size: 18px;">≈ ¥ </text>{{data.total}}</view>
		<view class="order-main-text">合计</view>
		<view class="order-header">
			<view class="order-time">
				<view class="time-text">预约时间 </view>
				<view class="time-num">{{data.appointment}}</view>
			</view>
			<view class="order-time" style="margin-top: 10px;">
				<view class="time-text">回收地址 </view>
				<view class="time-num">{{data.address}}</view>
			</view>
		</view>
		<view class="stats-text"><text class="linepice"></text><text>回收类目</text>
		</view>
		<view class="order-subject">
			<view class="sub-item" v-for="(item,index) in shoppingcartarr" :key="index">
				<view class="sub-child">
					<image :src="item.icon || '/static/img/feizhi.png'" class="sub-img"></image>
					<view class="sub-con">
						<view style="color: #242424;font-size: 15px;font-weight: bold;">{{item.name}}</view>
						<view style="color: #242424;padding-top: 12px;">参考单价：¥{{item.price}}/公斤</view>
						<view style="color: #242424">预估重量：{{item.weiMin}}-{{item.weiMax}}公斤</view>
					</view>
				</view>
			</view>
		</view>
		
		
		<view class="sub-item" v-if="data.info">
			<view class="sub-eit">
				<view class="eit-title">留言备注：</view>
				<view class="eit-text">{{data.info}}</view>
			</view>
		</view>
		
		
		
		<view class="appbut">
			<view class="but-he">
				<image src='/static/img/hezi_icon11.png' class="he-img"></image>
				<view class="but-cash">合计：<text style="font-size: 18px;font-weight: bold;">¥{{data.total}}</text></view>
			</view>
			<view class="appbut-ok" @click="hanldConfim()">提交订单</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data:'',
				shoppingcartarr:[]
				
			}
		},
	
		onLoad(options){
			if(options.data){
				this.data = JSON.parse(options.data)
				this.shoppingcartarr = JSON.parse(this.data.data)
			}	
		},
		methods: {
			
			
			//下单
          hanldConfim(){
			let formData = this.data
			uni.showLoading({})
			this.$http.order(formData).then(res => {
				uni.hideLoading()
				uni.showToast({
					title:res.msg,
					icon:'none'
				})
				if(res.code == 0){
					getApp().globalData.index = 1;
					setTimeout(() => {
						uni.navigateTo({
						 	 url:'/pages/index/index'
						})
					},1000)
				}
			})
		  }
		}
	}
</script>

<style scoped>
	.linepice{
		width: 24upx;height: 8upx;background: #2B2A29;border-radius: 8upx;display: block;margin-right: 5px;
	}
	.order {
		background-color: #F6F6F6;
		width: 100%;
		padding-bottom: 80px;
	}

	.add-type{
		color:#fff;
		font-size: 14px;
		font-weight: bold;
		text-align: center;
		width: 220upx;
		height: 96upx;
		border-radius: 10upx;
		background: linear-gradient(124deg, #6AA7E8 0%, #3D9AFD 100%);
		line-height: 96upx;
		margin: 0 auto;
		
	}


	.order-title {
		color: #3E9AFC;;
		font-size: 28px;
		font-weight: bold;
		padding: 17px 0 0 0;
		text-align: center;
		background-color: #FFFFFF;
	}
	.order-main-text{
		color: rgba(20, 16, 16, 1);
		font-size: 15px;
		text-align: center;
		padding-bottom: 12px;
		background-color: #FFFFFF;
	}

	.order-header {
		background-color: #FFFFFF;
		padding: 15px 20px;
	}

	.man-item {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		padding-bottom: 14px;
	}

	.item-header {
		width: 80%;
	}

	.item-right {
		display: flex;
		flex-direction: row;
		align-items: center;
		width: 20%;
		justify-content: flex-end;
				color: #3E9AFC;
		font-size: 15px;
		font-weight: bold;
	}

	.right-text {
		margin-left: 6px;
	}

	.item-right image {
		width: 24px;
		height: 24px;
		vertical-align: middle;
	}

	.item-add {
		color: #242424;
		font-size: 14px;
		font-weight: bold;
	}

	.order-time {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		background-color: rgba(187, 187, 187, 0.1);
		padding: 13px;
		border-radius: 5px;
	}

	.time-text {
		color: rgba(52, 54, 51, 1);
		font-size: 14px;
	}

	.time-num {
		color: rgba(36, 36, 36, 1);
		font-size: 15px;
		font-weight: bold;
	}

	.stats-text {
		font-size: 17px;
		font-weight: bold;
		padding: 10px 15px;
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.stats-num {
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	.order-subject{
		display: flex;
		flex-direction: column;
	}
	.sub-item{
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		background-color: #FFFFFF;
		padding: 20px;
		margin-bottom: 10px;
	}
	
	.sub-img{
		width: 50px;
		height: 50px;
		border-radius: 50%;
	}
	
		
	.sub-child{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		width: 100%;
	}
	.sub-con{
		    flex: 1;
			padding-left: 16px;
	}
	
	
	.appbut {
		border-radius: 25px;
		height: 96upx;
		background:#fff;
		width: 100%;
		position: fixed;
		bottom: 0;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		z-index: 99999999;
		color: #151515;
		border: 1px solid #979797;
	}
	
	.he-img {
		width: 40px;
		height: 40px;
	}
	
	.but-he {
		display: flex;
		flex-direction: row;
		align-items: center;
		color: #fff;
		font-size: 15px;
		position: relative;
		padding: 0 56upx;
		height: 96upx;
	}
	

	.but-cash {
		margin-left: 10px;
		color: #151515;
	}
	
	.appbut-ok {
		color:#fff;
		font-size: 14px;
		font-weight: bold;
		text-align: center;
		width: 220upx;
		height: 96upx;
		border-radius: 0 25px 25px 0;
	
background: linear-gradient(124deg, #6AA7E8 0%, #3D9AFD 100%);
		line-height: 96upx;
	}
	
	.sub-eit{
		display: flex;
		align-items: center;
	}
	.eit-title{
		color: rgba(36, 36, 36, 1);
		font-size: 14px;
		font-weight: bold;
		min-width: 80px;
	}
	.sub-info{
		background-color: #fff;
		margin-top: 10px;
		padding: 15px 20px;
	}
	
	
		/*重量*/
	
		.wei-body {
			display: flex;
			flex-direction: row;
			flex-wrap: wrap;
		}
	
		.wei-itme {
			width: 200upx;
			height: 58upx;
			background: rgba(187, 187, 187, 0.1);
			border-radius: 11upx;
			border: 1px solid rgba(151, 151, 151, 1);
			text-align: center;
			line-height: 58upx;
			margin-right: 20upx;
			margin-bottom: 13px;
		}
	
		.weiActive {
			
			background: linear-gradient(124deg, #6AA7E8 0%, #3D9AFD 100%);
			
	box-shadow: 0px 2px 4px 0px #1E75FF;
			border-radius: 11px;
			color: #FFFFFF;
			border: none;
		}
	
		/*商品栏弹框*/
		.cash {
			height: 940upx;
			background: rgba(255, 255, 255, 1);
			border-radius: 25px 25px 0px 0;
		}
	
		.cash-guan {
			width: 46upx;
			height: 46upx;
			position: absolute;
			right: 40upx;
			top: 42upx;
		}
	
		.cash-header {
			border-bottom: 1px solid rgba(217, 217, 219, 1);
			text-align: center;
			display: flex;
			    flex-direction: revert;
			    justify-content: center;
		}
	
		.order-subject {
			display: flex;
			flex-direction: column;
		}
	
		.sub-item {
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: space-between;
			background-color: #FFFFFF;
			padding: 20px;
			border-bottom: 1px solid #EDEDED
		}
	
		.sub-img {
			width: 50px;
			height: 50px;
			border-radius: 50%;
		}
	
	
		.sub-child {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			width: 100%;
		}
	
		.sub-con {
			flex: 1;
			padding-left: 16px;
		}
	
		.add_img {
			width: 28px;
			height: 28px;
			margin-top: 70upx;
		}
	
		/*立即预约弹框*/
		.cash2 {
			height: 750upx;
			background: rgba(255, 255, 255, 1);
			border-radius: 25px 25px 0px 0;
			display: flex;
			flex-direction: column;
			align-items: center;
			padding: 10px 15px;
		}
	
		.cash-guan2 {
			width: 46upx;
			height: 46upx;
			position: absolute;
			right: 40upx;
			top: 42upx;
		}
	
		.cash-fei2 {
			width: 50px;
			height: 50px;
		}
	
		.cash-wrapper2 {
			display: flex;
			flex-direction: column;
			width: 100%;
			margin-top: 14px;
		}
	
		.cash-item2 {
			height: 92upx;
			background: rgba(187, 187, 187, 0.1);
			border-radius: 10upx;
			align-items: center;
			justify-content: space-between;
			display: flex;
			flex-direction: row;
			margin-bottom: 6px;
			padding: 0 12px;
		}
	
		.cash-left2 {
			color: rgba(52, 54, 51, 1);
			font-size: 14px;
		}
	
		.cash-right2 {
			color: rgba(36, 36, 36, 1);
			font-size: 15px;
			font-weight: bold;
		}
	
		.cash-num2 {
			margin: 20px 0;
			color: rgba(20, 16, 16, 1);
			font-size: 18px;
			font-weight: bold;
		}
	
		.cash-but2 {
			width: 750upx;
			height: 96upx;
			
			background: linear-gradient(124deg, #6AA7E8 0%, #3D9AFD 100%);
			
	box-shadow: 0px 2px 4px 0px #1E75FF;
			border-radius: 48upx;
			text-align: center;
			font-size: 16px;
			line-height: 96upx;
			font-weight: bold;
			position: fixed;
			bottom: 0;
			color: #FFFFFF;
		}
	
		/*公益赠送*/
	
		.cash3 {
			height: 750upx;
			background: rgba(255, 255, 255, 1);
			border-radius: 25px 25px 0px 0;
			display: flex;
			flex-direction: column;
			align-items: center;
			padding: 10px 15px;
		}
	
		.gongyi {
			height: 400upx;
			width: 545upx;
			margin: 73upx 0 43upx 0;
		}
	
		.cash-text3 {
			color: rgba(52, 54, 51, 1);
			font-size: 16px;
			font-weight: bold;
		}
	
		.cash-but3 {
			display: flex;
			flex-direction: row;
			position: fixed;
			bottom: 0;
			justify-content: space-between;
			width: 100%;
		}
	
		.but-left3 {
			background-color: rgba(211, 212, 217, 1);
			width: 50%;
			height: 48px;
			text-align: center;
			font-size: 16px;
			color: rgba(57, 61, 84, 1);
			font-weight: bold;
			line-height: 48px;
		}
	
		.but-right3 {
			background: linear-gradient(124deg, #6AA7E8 0%, #3D9AFD 100%);
			
	box-shadow: 0px 2px 4px 0px #1E75FF;
			width: 50%;
			height: 48px;
			text-align: center;
			font-size: 16px;
			color: #fff;
			font-weight: bold;
			line-height: 48px;
		}
	
	
		.par-tar {
			display: flex;
			align-items: flex-start;
			background-color: rgba(187, 187, 187, 0.1);
			height: 100px;
			border-radius: 5px;
			padding: 12px 0;
		}
	
		.uni-textarea-placeholder {
			font-size: 12px;
			color: #898989;
		}
	
		.iphone-text {
			color: #242424;
			font-size: 14px;
			padding: 0 12px;
			min-width: 160upx;
			margin-top: -2px;
		}
	
		.address-text {
			color: #242424;
			font-size: 13px;
			padding-left: 5px;
		}
	
		.app-time {
			display: flex;
			margin-top: 10px;
		}
</style>
